//
// Created by Administrator on 2021/10/20.
//
#include <iostream>
#include <vector>
#include <list>

using namespace std;

int processSuitors(vector<int>& vector, list<int>& list)
{
    if (vector.empty())
    {
        return NULL;
    }
    int index = 0;
    for (int i = 0; i < vector.size() && vector.size() > 1; ++i)
    {
        index++;
        if (index == 3)
        {
            list.push_back(vector[i]);
            vector.erase(vector.begin() + i);
            i--;
            index = 0;
        }
        if (i == vector.size() - 1)
        {
            i = -1;
        }
    }
    return vector[0];
}

int main() {
    vector<int> vector{1, 2, 3, 4, 5, 6};
    list<int> list;
    cout << processSuitors(vector, list) << endl;
    return 0;
}

